import request from '@/utils/request'

//注册接口
export const userRegisterService = ({username, password, repassword}) =>{
  return request.post('/api/register',{username, password, repassword})
}

//登录接口
export const userLoginService = ({ username, password}) => 
request.post('/api/login',{ username, password})

//获取用户基本信息
export const userGetInfoService = () => request.get('/my/userinfo')

//修改用户信息接口
export const userUpdateInfoService = ({ id , nickname, email} ) => 
request.put('/my/updateuserinfo', { id , nickname, email})

//更新用户头像
export const userUpdateAvatarService = (avatar) =>
   request.post('/my/updateavatar', {avatar} )

  //更新用户密码
  export const userUpdatePasswordService = ({old_pwd, new_pwd, re_pwd }) =>
  request.patch('/my/updatepwd',{old_pwd, new_pwd, re_pwd})
 
 